<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>缩放 (Scaling)</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="GDK-PixBuf参考手册">
<link rel="up" href="rn01.html" title="API 参考">
<link rel="prev" href="gdk-pixbuf-Inline-data.html" title="Inline data">
<link rel="next" href="gdk-pixbuf-gdk-pixbuf-rendering.html" title="渲染">
<meta name="generator" content="GTK-Doc V1.17 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="gdk-pixbuf-Inline-data.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="rn01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GDK-PixBuf参考手册</th>
<td><a accesskey="n" href="gdk-pixbuf-gdk-pixbuf-rendering.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#gdk-pixbuf-%E7%BC%A9%E6%94%BE-(Scaling).synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#gdk-pixbuf-%E7%BC%A9%E6%94%BE-(Scaling).description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry">
<a name="gdk-pixbuf-%E7%BC%A9%E6%94%BE-(Scaling)"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="gdk-pixbuf-%E7%BC%A9%E6%94%BE-(Scaling).top_of_page"></a>缩放 (Scaling)</span></h2>
<p>缩放 (Scaling) — 缩放pixbuf和缩放并合并pixbuf。</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="gdk-pixbuf-%E7%BC%A9%E6%94%BE-(Scaling).synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include &lt;gdk-pixbuf/gdk-pixbuf.h&gt;

enum                <a class="link" href="gdk-pixbuf-%E7%BC%A9%E6%94%BE-(Scaling).html#GdkInterpType" title="enum GdkInterpType">GdkInterpType</a>;
<a class="link" href="gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf"><span class="returnvalue">GdkPixbuf</span></a> *         <a class="link" href="gdk-pixbuf-%E7%BC%A9%E6%94%BE-(Scaling).html#gdk-pixbuf-scale-simple" title="gdk_pixbuf_scale_simple ()">gdk_pixbuf_scale_simple</a>             (<em class="parameter"><code>const <a class="link" href="gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf"><span class="type">GdkPixbuf</span></a> *src</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> dest_width</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> dest_height</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gdk-pixbuf-%E7%BC%A9%E6%94%BE-(Scaling).html#GdkInterpType" title="enum GdkInterpType"><span class="type">GdkInterpType</span></a> interp_type</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gdk-pixbuf-%E7%BC%A9%E6%94%BE-(Scaling).html#gdk-pixbuf-scale" title="gdk_pixbuf_scale ()">gdk_pixbuf_scale</a>                    (<em class="parameter"><code>const <a class="link" href="gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf"><span class="type">GdkPixbuf</span></a> *src</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf"><span class="type">GdkPixbuf</span></a> *dest</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> dest_x</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> dest_y</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> dest_width</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> dest_height</code></em>,
                                                         <em class="parameter"><code><span class="type">double</span> offset_x</code></em>,
                                                         <em class="parameter"><code><span class="type">double</span> offset_y</code></em>,
                                                         <em class="parameter"><code><span class="type">double</span> scale_x</code></em>,
                                                         <em class="parameter"><code><span class="type">double</span> scale_y</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gdk-pixbuf-%E7%BC%A9%E6%94%BE-(Scaling).html#GdkInterpType" title="enum GdkInterpType"><span class="type">GdkInterpType</span></a> interp_type</code></em>);
<a class="link" href="gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf"><span class="returnvalue">GdkPixbuf</span></a> *         <a class="link" href="gdk-pixbuf-%E7%BC%A9%E6%94%BE-(Scaling).html#gdk-pixbuf-composite-color-simple" title="gdk_pixbuf_composite_color_simple ()">gdk_pixbuf_composite_color_simple</a>   (<em class="parameter"><code>const <a class="link" href="gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf"><span class="type">GdkPixbuf</span></a> *src</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> dest_width</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> dest_height</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gdk-pixbuf-%E7%BC%A9%E6%94%BE-(Scaling).html#GdkInterpType" title="enum GdkInterpType"><span class="type">GdkInterpType</span></a> interp_type</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> overall_alpha</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> check_size</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> color1</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> color2</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gdk-pixbuf-%E7%BC%A9%E6%94%BE-(Scaling).html#gdk-pixbuf-composite" title="gdk_pixbuf_composite ()">gdk_pixbuf_composite</a>                (<em class="parameter"><code>const <a class="link" href="gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf"><span class="type">GdkPixbuf</span></a> *src</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf"><span class="type">GdkPixbuf</span></a> *dest</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> dest_x</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> dest_y</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> dest_width</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> dest_height</code></em>,
                                                         <em class="parameter"><code><span class="type">double</span> offset_x</code></em>,
                                                         <em class="parameter"><code><span class="type">double</span> offset_y</code></em>,
                                                         <em class="parameter"><code><span class="type">double</span> scale_x</code></em>,
                                                         <em class="parameter"><code><span class="type">double</span> scale_y</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gdk-pixbuf-%E7%BC%A9%E6%94%BE-(Scaling).html#GdkInterpType" title="enum GdkInterpType"><span class="type">GdkInterpType</span></a> interp_type</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> overall_alpha</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gdk-pixbuf-%E7%BC%A9%E6%94%BE-(Scaling).html#gdk-pixbuf-composite-color" title="gdk_pixbuf_composite_color ()">gdk_pixbuf_composite_color</a>          (<em class="parameter"><code>const <a class="link" href="gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf"><span class="type">GdkPixbuf</span></a> *src</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf"><span class="type">GdkPixbuf</span></a> *dest</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> dest_x</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> dest_y</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> dest_width</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> dest_height</code></em>,
                                                         <em class="parameter"><code><span class="type">double</span> offset_x</code></em>,
                                                         <em class="parameter"><code><span class="type">double</span> offset_y</code></em>,
                                                         <em class="parameter"><code><span class="type">double</span> scale_x</code></em>,
                                                         <em class="parameter"><code><span class="type">double</span> scale_y</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gdk-pixbuf-%E7%BC%A9%E6%94%BE-(Scaling).html#GdkInterpType" title="enum GdkInterpType"><span class="type">GdkInterpType</span></a> interp_type</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> overall_alpha</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> check_x</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> check_y</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> check_size</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> color1</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> color2</code></em>);
enum                <a class="link" href="gdk-pixbuf-%E7%BC%A9%E6%94%BE-(Scaling).html#GdkPixbufRotation" title="enum GdkPixbufRotation">GdkPixbufRotation</a>;
<a class="link" href="gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf"><span class="returnvalue">GdkPixbuf</span></a> *         <a class="link" href="gdk-pixbuf-%E7%BC%A9%E6%94%BE-(Scaling).html#gdk-pixbuf-rotate-simple" title="gdk_pixbuf_rotate_simple ()">gdk_pixbuf_rotate_simple</a>            (<em class="parameter"><code>const <a class="link" href="gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf"><span class="type">GdkPixbuf</span></a> *src</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gdk-pixbuf-%E7%BC%A9%E6%94%BE-(Scaling).html#GdkPixbufRotation" title="enum GdkPixbufRotation"><span class="type">GdkPixbufRotation</span></a> angle</code></em>);
<a class="link" href="gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf"><span class="returnvalue">GdkPixbuf</span></a> *         <a class="link" href="gdk-pixbuf-%E7%BC%A9%E6%94%BE-(Scaling).html#gdk-pixbuf-flip" title="gdk_pixbuf_flip ()">gdk_pixbuf_flip</a>                     (<em class="parameter"><code>const <a class="link" href="gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf"><span class="type">GdkPixbuf</span></a> *src</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> horizontal</code></em>);
</pre>
</div>
<div class="refsect1">
<a name="gdk-pixbuf-%E7%BC%A9%E6%94%BE-(Scaling).description"></a><h2>Description</h2>
<p>
&amp;gdk-pixbuf; 包含一些缩放pixbuf的函数，这些函数可以用来缩放pixbuf并与已有的图
像合并，还可以缩放pixbuf并与实体颜色(solid color)或颜色棋盘(checkerboard)。与
颜色棋盘(checkerboard)合并是图像查看和编辑软件显示带alpha通道的图像的常用方
法。
</p>
<p>
因为完全特性(full-featured)函数(<a class="link" href="gdk-pixbuf-%E7%BC%A9%E6%94%BE-(Scaling).html#gdk-pixbuf-scale" title="gdk_pixbuf_scale ()"><code class="function">gdk_pixbuf_scale()</code></a>,<a class="link" href="gdk-pixbuf-%E7%BC%A9%E6%94%BE-(Scaling).html#gdk-pixbuf-composite" title="gdk_pixbuf_composite ()"><code class="function">gdk_pixbuf_composite()</code></a>, 
and <a class="link" href="gdk-pixbuf-%E7%BC%A9%E6%94%BE-(Scaling).html#gdk-pixbuf-composite-color" title="gdk_pixbuf_composite_color ()"><code class="function">gdk_pixbuf_composite_color()</code></a>)使用起来非常复杂而且有很多参数，所以提供了两
个简单便捷的函数，<a class="link" href="gdk-pixbuf-%E7%BC%A9%E6%94%BE-(Scaling).html#gdk-pixbuf-scale-simple" title="gdk_pixbuf_scale_simple ()"><code class="function">gdk_pixbuf_scale_simple()</code></a> 和 
<a class="link" href="gdk-pixbuf-%E7%BC%A9%E6%94%BE-(Scaling).html#gdk-pixbuf-composite-color-simple" title="gdk_pixbuf_composite_color_simple ()"><code class="function">gdk_pixbuf_composite_color_simple()</code></a>，这两个函数按给定的大小创建一个新的pixbuf
并将缩放原始图像来适应它，然后返回这个新的pixbuf。
</p>
<p>
Scaling and compositing functions take advantage of MMX hardware
acceleration on systems where MMX is supported.  If gdk-pixbuf is built
with the Sun mediaLib library, these functions are instead accelerated
using mediaLib, which provides hardware acceleration on Intel, AMD,
and Sparc chipsets.  If desired, mediaLib support can be turned off by
setting the GDK_DISABLE_MEDIALIB environment variable.  
</p>
<p>
下面的例子演示了通过将源图像(已经缩放到适合构件的尺寸)的一个适当的区域渲染到
构件的窗体上来处理一个expose事件。这个源图像与一个棋盘(checkerboard)合成，如
果源图像有alpha通道那么这个棋盘将提供一个alpha通道的视觉表现。如果源图像没有
alpha通道，调用<a class="link" href="gdk-pixbuf-%E7%BC%A9%E6%94%BE-(Scaling).html#gdk-pixbuf-composite-color" title="gdk_pixbuf_composite_color ()"><code class="function">gdk_pixbuf_composite_color()</code></a> 和 调用 <a class="link" href="gdk-pixbuf-%E7%BC%A9%E6%94%BE-(Scaling).html#gdk-pixbuf-scale" title="gdk_pixbuf_scale ()"><code class="function">gdk_pixbuf_scale()</code></a> 的效果
是完全一样的。
</p>
<p>
</p>
<div class="example">
<a name="id2855895"></a><p class="title"><b>Example 2. 处理一个expose事件。</b></p>
<div class="example-contents">
<p>
</p>
<pre class="programlisting">
gboolean
expose_cb (GtkWidget *widget, GdkEventExpose *event, gpointer data)
{
  GdkPixbuf *dest;

  dest = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, event-&gt;area.width, event-&gt;area.height);

  gdk_pixbuf_composite_color (pixbuf, dest,
                              0, 0, event-&gt;area.width, event-&gt;area.height,
                              -event-&gt;area.x, -event-&gt;area.y,
                              (double) widget-&gt;allocation.width / gdk_pixbuf_get_width (pixbuf),
                              (double) widget-&gt;allocation.height / gdk_pixbuf_get_height (pixbuf),
                              GDK_INTERP_BILINEAR, 255,
                              event-&gt;area.x, event-&gt;area.y, 16, 0xaaaaaa, 0x555555);

  gdk_draw_pixbuf (widget-&gt;window, widget-&gt;style-&gt;fg_gc[GTK_STATE_NORMAL], dest,
                   0, 0, event-&gt;area.x, event-&gt;area.y,
                   event-&gt;area.width, event-&gt;area.height,
                   GDK_RGB_DITHER_NORMAL, event-&gt;area.x, event-&gt;area.y);
  
  gdk_pixbuf_unref (dest);
  
  return TRUE;
}
</pre>
<p>
</p>
</div>
</div>
<p><br class="example-break">
</p>
</div>
<div class="refsect1">
<a name="gdk-pixbuf-%E7%BC%A9%E6%94%BE-(Scaling).details"></a><h2>Details</h2>
<div class="refsect2">
<a name="GdkInterpType"></a><h3>enum GdkInterpType</h3>
<pre class="programlisting">typedef enum {
	GDK_INTERP_NEAREST,
	GDK_INTERP_TILES,
	GDK_INTERP_BILINEAR,
	GDK_INTERP_HYPER
} GdkInterpType;
</pre>
<p>
This enumeration describes the different interpolation modes that
 can be used with the scaling functions. <em class="parameter"><code>GDK_INTERP_NEAREST</code></em> is 
 the fastest scaling method, but has horrible quality when 
 scaling down. <em class="parameter"><code>GDK_INTERP_BILINEAR</code></em> is the best choice if you 
 aren't sure what to choose, it has a good speed/quality balance.
</p>
<p>
 </p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Note</h3>
	Cubic filtering is missing from the list; hyperbolic
	interpolation is just as fast and results in higher quality.
 </div>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><a name="GDK-INTERP-NEAREST:CAPS"></a><span class="term"><code class="literal">GDK_INTERP_NEAREST</code></span></p></td>
<td>Nearest neighbor sampling; this is the fastest
 and lowest quality mode. Quality is normally unacceptable when scaling 
 down, but may be OK when scaling up.
</td>
</tr>
<tr>
<td><p><a name="GDK-INTERP-TILES:CAPS"></a><span class="term"><code class="literal">GDK_INTERP_TILES</code></span></p></td>
<td>This is an accurate simulation of the PostScript
 image operator without any interpolation enabled.  Each pixel is
 rendered as a tiny parallelogram of solid color, the edges of which
 are implemented with antialiasing.  It resembles nearest neighbor for
 enlargement, and bilinear for reduction.
</td>
</tr>
<tr>
<td><p><a name="GDK-INTERP-BILINEAR:CAPS"></a><span class="term"><code class="literal">GDK_INTERP_BILINEAR</code></span></p></td>
<td>Best quality/speed balance; use this mode by
 default. Bilinear interpolation.  For enlargement, it is
 equivalent to point-sampling the ideal bilinear-interpolated image.
 For reduction, it is equivalent to laying down small tiles and
 integrating over the coverage area.
</td>
</tr>
<tr>
<td><p><a name="GDK-INTERP-HYPER:CAPS"></a><span class="term"><code class="literal">GDK_INTERP_HYPER</code></span></p></td>
<td>This is the slowest and highest quality
 reconstruction function. It is derived from the hyperbolic filters in
 Wolberg's "Digital Image Warping", and is formally defined as the
 hyperbolic-filter sampling the ideal hyperbolic-filter interpolated
 image (the filter is designed to be idempotent for 1:1 pixel mapping).
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-pixbuf-scale-simple"></a><h3>gdk_pixbuf_scale_simple ()</h3>
<pre class="programlisting"><a class="link" href="gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf"><span class="returnvalue">GdkPixbuf</span></a> *         gdk_pixbuf_scale_simple             (<em class="parameter"><code>const <a class="link" href="gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf"><span class="type">GdkPixbuf</span></a> *src</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> dest_width</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> dest_height</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gdk-pixbuf-%E7%BC%A9%E6%94%BE-(Scaling).html#GdkInterpType" title="enum GdkInterpType"><span class="type">GdkInterpType</span></a> interp_type</code></em>);</pre>
<p>
创建一个包含 <em class="parameter"><code>src</code></em> 缩放到 <em class="parameter"><code>dest_width</code></em> 和 <em class="parameter"><code>dest_height</code></em> 的新的 <a class="link" href="gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf"><span class="type">GdkPixbuf</span></a>。保持 
<em class="parameter"><code>src</code></em> 不受影响。如果想速度最大化可以给 <em class="parameter"><code>interp_type</code></em> 传递 <a class="link" href="gdk-pixbuf-%E7%BC%A9%E6%94%BE-(Scaling).html#GDK-INTERP-NEAREST:CAPS"><span class="type">GDK_INTERP_NEAREST</span></a>
(但当 <a class="link" href="gdk-pixbuf-%E7%BC%A9%E6%94%BE-(Scaling).html#GDK-INTERP-NEAREST:CAPS"><span class="type">GDK_INTERP_NEAREST</span></a> 缩小时图像一般会变的相当难看)。 <em class="parameter"><code>interp_type</code></em> 默认值
为 <a class="link" href="gdk-pixbuf-%E7%BC%A9%E6%94%BE-(Scaling).html#GDK-INTERP-BILINEAR:CAPS"><span class="type">GDK_INTERP_BILINEAR</span></a>，该值提供了一个合理的质量和速度。
</p>
<p>
通过创建一个指向 $src 的 sub-pixbuf 可以缩放 <em class="parameter"><code>src</code></em> 的一部分；参见 
<a class="link" href="gdk-pixbuf-%E5%86%85%E5%AD%98%E4%B8%AD%E7%9A%84%E5%9B%BE%E8%B1%A1%E6%95%B0%E6%8D%AE(Image-Data-in-Memory).html#gdk-pixbuf-new-subpixbuf" title="gdk_pixbuf_new_subpixbuf ()"><code class="function">gdk_pixbuf_new_subpixbuf()</code></a>。
</p>
<p>
更复杂的缩放/合成请参见 <a class="link" href="gdk-pixbuf-%E7%BC%A9%E6%94%BE-(Scaling).html#gdk-pixbuf-scale" title="gdk_pixbuf_scale ()"><code class="function">gdk_pixbuf_scale()</code></a> 和 <a class="link" href="gdk-pixbuf-%E7%BC%A9%E6%94%BE-(Scaling).html#gdk-pixbuf-composite" title="gdk_pixbuf_composite ()"><code class="function">gdk_pixbuf_composite()</code></a>。
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>src</code></em> :</span></p></td>
<td>a <a class="link" href="gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf"><span class="type">GdkPixbuf</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>dest_width</code></em> :</span></p></td>
<td>目标图像的宽度</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>dest_height</code></em> :</span></p></td>
<td>目标图像的高度</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>interp_type</code></em> :</span></p></td>
<td>变形时使用的插值类型。</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>一个新的 <a class="link" href="gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf"><span class="type">GdkPixbuf</span></a>，内存不足返回 <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>。. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-pixbuf-scale"></a><h3>gdk_pixbuf_scale ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gdk_pixbuf_scale                    (<em class="parameter"><code>const <a class="link" href="gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf"><span class="type">GdkPixbuf</span></a> *src</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf"><span class="type">GdkPixbuf</span></a> *dest</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> dest_x</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> dest_y</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> dest_width</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> dest_height</code></em>,
                                                         <em class="parameter"><code><span class="type">double</span> offset_x</code></em>,
                                                         <em class="parameter"><code><span class="type">double</span> offset_y</code></em>,
                                                         <em class="parameter"><code><span class="type">double</span> scale_x</code></em>,
                                                         <em class="parameter"><code><span class="type">double</span> scale_y</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gdk-pixbuf-%E7%BC%A9%E6%94%BE-(Scaling).html#GdkInterpType" title="enum GdkInterpType"><span class="type">GdkInterpType</span></a> interp_type</code></em>);</pre>
<p>
通过 <em class="parameter"><code>scale_x</code></em> 和 $scale_y 指定的缩放以及 <em class="parameter"><code>offset_x</code></em> 和 <em class="parameter"><code>offset_y</code></em> 指定的偏移量
创建一个原始图像 <em class="parameter"><code>src</code></em> 的变形图像，并将其一个矩形区域(<em class="parameter"><code>dest_x</code></em>, <em class="parameter"><code>dest_y</code></em>, 
<em class="parameter"><code>dest_width</code></em>, <em class="parameter"><code>dest_height</code></em>)渲染到目标图像以取代先前的内容。
</p>
<p>
先尝试使用 <a class="link" href="gdk-pixbuf-%E7%BC%A9%E6%94%BE-(Scaling).html#gdk-pixbuf-scale-simple" title="gdk_pixbuf_scale_simple ()"><code class="function">gdk_pixbuf_scale_simple()</code></a> ，如果 <a class="link" href="gdk-pixbuf-%E7%BC%A9%E6%94%BE-(Scaling).html#gdk-pixbuf-scale-simple" title="gdk_pixbuf_scale_simple ()"><code class="function">gdk_pixbuf_scale_simple()</code></a> 不够强
大时你可以退回来使用这是一个工业强度(industrial-strength)的有用工具。
</p>
<p>
如果源矩形重叠在同一个pixbuf目标矩形，在缩放渲染artifacts结果的期间它会被覆
盖。
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>src</code></em> :</span></p></td>
<td>a <a class="link" href="gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf"><span class="type">GdkPixbuf</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>dest</code></em> :</span></p></td>
<td>这个 <a class="link" href="gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf"><span class="type">GdkPixbuf</span></a> 要渲染的目标。</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>dest_x</code></em> :</span></p></td>
<td>要渲染的区域的左坐标值。</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>dest_y</code></em> :</span></p></td>
<td>要渲染的区域的顶坐标值。</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>dest_width</code></em> :</span></p></td>
<td>要渲染的区域的宽度。</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>dest_height</code></em> :</span></p></td>
<td>要渲染的区域的高度。</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>offset_x</code></em> :</span></p></td>
<td>X 方向的偏移值(当前近似到整数)。</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>offset_x</code></em> :</span></p></td>
<td>Y 方向的偏移值(当前近似到整数)。</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>scale_x</code></em> :</span></p></td>
<td>X 坐标方向上的比例数</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>scale_y</code></em> :</span></p></td>
<td>Y 坐标方向上的比例数</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>interp_type</code></em> :</span></p></td>
<td>变形时使用的插值类型。</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-pixbuf-composite-color-simple"></a><h3>gdk_pixbuf_composite_color_simple ()</h3>
<pre class="programlisting"><a class="link" href="gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf"><span class="returnvalue">GdkPixbuf</span></a> *         gdk_pixbuf_composite_color_simple   (<em class="parameter"><code>const <a class="link" href="gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf"><span class="type">GdkPixbuf</span></a> *src</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> dest_width</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> dest_height</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gdk-pixbuf-%E7%BC%A9%E6%94%BE-(Scaling).html#GdkInterpType" title="enum GdkInterpType"><span class="type">GdkInterpType</span></a> interp_type</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> overall_alpha</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> check_size</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> color1</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> color2</code></em>);</pre>
<p>
通过缩放 <em class="parameter"><code>src</code></em> 到 <em class="parameter"><code>dest_width</code></em> x <em class="parameter"><code>dest_height</code></em> 并将结果与颜色为 <em class="parameter"><code>color1</code></em> 和 
<em class="parameter"><code>color2</code></em> 的棋盘合成来创建一个新的 <a class="link" href="gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf"><span class="type">GdkPixbuf</span></a>。
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>src</code></em> :</span></p></td>
<td>a <a class="link" href="gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf"><span class="type">GdkPixbuf</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>dest_width</code></em> :</span></p></td>
<td>目标图像的宽度</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>dest_height</code></em> :</span></p></td>
<td>目标图像的高度</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>interp_type</code></em> :</span></p></td>
<td>变形时使用的插值类型。</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>overall_alpha</code></em> :</span></p></td>
<td>原图像的整体 alpha 值(0..255)</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>check_size</code></em> :</span></p></td>
<td>棋盘(checkboard)的格子数(必须为2次方幂) <em class="parameter"><code>color1</code></em>: 左上方的格子的
颜色 <em class="parameter"><code>color2</code></em>: 其他格子的颜色。</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>一个新的 <a class="link" href="gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf"><span class="type">GdkPixbuf</span></a>，内存不足返回 <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>。. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-pixbuf-composite"></a><h3>gdk_pixbuf_composite ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gdk_pixbuf_composite                (<em class="parameter"><code>const <a class="link" href="gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf"><span class="type">GdkPixbuf</span></a> *src</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf"><span class="type">GdkPixbuf</span></a> *dest</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> dest_x</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> dest_y</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> dest_width</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> dest_height</code></em>,
                                                         <em class="parameter"><code><span class="type">double</span> offset_x</code></em>,
                                                         <em class="parameter"><code><span class="type">double</span> offset_y</code></em>,
                                                         <em class="parameter"><code><span class="type">double</span> scale_x</code></em>,
                                                         <em class="parameter"><code><span class="type">double</span> scale_y</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gdk-pixbuf-%E7%BC%A9%E6%94%BE-(Scaling).html#GdkInterpType" title="enum GdkInterpType"><span class="type">GdkInterpType</span></a> interp_type</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> overall_alpha</code></em>);</pre>
<p>
通过 <em class="parameter"><code>scale_x</code></em> 和 $scale_y 指定的缩放以及 <em class="parameter"><code>offset_x</code></em> 和 <em class="parameter"><code>offset_y</code></em> 指定的偏移量
创建一个原始图像 <em class="parameter"><code>src</code></em> 的变形图像。这给出了一个在目标 pixbuf 坐标里的一个图
像。该图像昂的一个矩形区域(<em class="parameter"><code>dest_x</code></em>, <em class="parameter"><code>dest_y</code></em>, <em class="parameter"><code>dest_width</code></em>, <em class="parameter"><code>dest_height</code></em>)会和原
始目标图像的相应矩形区域合成。
</p>
<p>
当目标矩形包含一个并不在源图像之内的一个区域时，则源图像的边缘将被无限大的复
制。
</p>
<p>
</p>
<div class="figure">
<a name="pixbuf-composite-diagram"></a><p class="title"><b>Figure 1. pixbuf 的合成</b></p>
<div class="figure-contents"><div><img src="composite.png" alt="pixbuf 的合成"></div></div>
</div>
<p><br class="figure-break">
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>src</code></em> :</span></p></td>
<td>a <a class="link" href="gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf"><span class="type">GdkPixbuf</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>dest</code></em> :</span></p></td>
<td>这个 <a class="link" href="gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf"><span class="type">GdkPixbuf</span></a> 要渲染的目标。</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>dest_x</code></em> :</span></p></td>
<td>要渲染的区域的左坐标值。</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>dest_y</code></em> :</span></p></td>
<td>要渲染的区域的顶坐标值。</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>dest_width</code></em> :</span></p></td>
<td>要渲染的区域的宽度。</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>dest_height</code></em> :</span></p></td>
<td>要渲染的区域的高度。</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>offset_x</code></em> :</span></p></td>
<td>X 方向的偏移值(当前近似到整数)。</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>offset_x</code></em> :</span></p></td>
<td>Y 方向的偏移值(当前近似到整数)。</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>scale_x</code></em> :</span></p></td>
<td>X 坐标方向上的比例数</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>scale_y</code></em> :</span></p></td>
<td>Y 坐标方向上的比例数</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>interp_type</code></em> :</span></p></td>
<td>变形时使用的插值类型。</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>overall_alpha</code></em> :</span></p></td>
<td>原图像的整体 alpha 值(0..255)</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-pixbuf-composite-color"></a><h3>gdk_pixbuf_composite_color ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gdk_pixbuf_composite_color          (<em class="parameter"><code>const <a class="link" href="gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf"><span class="type">GdkPixbuf</span></a> *src</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf"><span class="type">GdkPixbuf</span></a> *dest</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> dest_x</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> dest_y</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> dest_width</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> dest_height</code></em>,
                                                         <em class="parameter"><code><span class="type">double</span> offset_x</code></em>,
                                                         <em class="parameter"><code><span class="type">double</span> offset_y</code></em>,
                                                         <em class="parameter"><code><span class="type">double</span> scale_x</code></em>,
                                                         <em class="parameter"><code><span class="type">double</span> scale_y</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gdk-pixbuf-%E7%BC%A9%E6%94%BE-(Scaling).html#GdkInterpType" title="enum GdkInterpType"><span class="type">GdkInterpType</span></a> interp_type</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> overall_alpha</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> check_x</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> check_y</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> check_size</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> color1</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> color2</code></em>);</pre>
<p>
通过 <em class="parameter"><code>scale_x</code></em> 和 <em class="parameter"><code>scale_y</code></em> 指定的缩放以及 <em class="parameter"><code>offset_x</code></em> 和 <em class="parameter"><code>offset_y</code></em> 指定的偏移量
创建一个原始图像 <em class="parameter"><code>src</code></em> 的变形图像，然后将这个变型图像的一个矩形区域(<em class="parameter"><code>dest_x</code></em> ,
<em class="parameter"><code>dest_y</code></em>, <em class="parameter"><code>dest_width</code></em>, <em class="parameter"><code>dest_height</code></em>)与 <em class="parameter"><code>color1</code></em> 和 <em class="parameter"><code>color2</code></em> 组成的棋盘
(checkboard)合成，并将其渲染到目标图像。
</p>
<p>
参见 <a class="link" href="gdk-pixbuf-%E7%BC%A9%E6%94%BE-(Scaling).html#gdk-pixbuf-composite-color-simple" title="gdk_pixbuf_composite_color_simple ()"><code class="function">gdk_pixbuf_composite_color_simple()</code></a> ，一个适用于很多任务的比该函数更少参
数的函数。
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>src</code></em> :</span></p></td>
<td>a <a class="link" href="gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf"><span class="type">GdkPixbuf</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>dest</code></em> :</span></p></td>
<td>这个 <a class="link" href="gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf"><span class="type">GdkPixbuf</span></a> 要渲染的目标。</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>dest_x</code></em> :</span></p></td>
<td>要渲染的区域的左坐标值。</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>dest_y</code></em> :</span></p></td>
<td>要渲染的区域的顶坐标值。</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>dest_width</code></em> :</span></p></td>
<td>要渲染的区域的宽度。</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>dest_height</code></em> :</span></p></td>
<td>要渲染的区域的高度。</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>offset_x</code></em> :</span></p></td>
<td>X 方向的偏移值(当前近似到整数)。</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>offset_x</code></em> :</span></p></td>
<td>Y 方向的偏移值(当前近似到整数)。</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>scale_x</code></em> :</span></p></td>
<td>X 坐标方向上的比例数</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>scale_y</code></em> :</span></p></td>
<td>Y 坐标方向上的比例数</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>interp_type</code></em> :</span></p></td>
<td>变形时使用的插值类型。</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>overall_alpha</code></em> :</span></p></td>
<td>原图像的整体 alpha 值(0..255)</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>check_x</code></em> :</span></p></td>
<td>棋盘(checkboard)的X偏移值(棋盘的起点位置在 -<em class="parameter"><code>check_x</code></em>, -<em class="parameter"><code>check_y</code></em>)。</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>check_y</code></em> :</span></p></td>
<td>棋盘(checkboard)的Y偏移值。</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>check_size</code></em> :</span></p></td>
<td>棋盘(checkboard)的格子数(必须为2次方幂) <em class="parameter"><code>color1</code></em>: 左上方的格子的
颜色 <em class="parameter"><code>color2</code></em>: 其他格子的颜色。</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="GdkPixbufRotation"></a><h3>enum GdkPixbufRotation</h3>
<pre class="programlisting">typedef enum {
	GDK_PIXBUF_ROTATE_NONE             =   0,
	GDK_PIXBUF_ROTATE_COUNTERCLOCKWISE =  90,
	GDK_PIXBUF_ROTATE_UPSIDEDOWN       = 180,
	GDK_PIXBUF_ROTATE_CLOCKWISE        = 270
} GdkPixbufRotation;
</pre>
<p>
The possible rotations which can be passed to <a class="link" href="gdk-pixbuf-%E7%BC%A9%E6%94%BE-(Scaling).html#gdk-pixbuf-rotate-simple" title="gdk_pixbuf_rotate_simple ()"><code class="function">gdk_pixbuf_rotate_simple()</code></a>.
To make them easier to use, their numerical values are the actual degrees.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><a name="GDK-PIXBUF-ROTATE-NONE:CAPS"></a><span class="term"><code class="literal">GDK_PIXBUF_ROTATE_NONE</code></span></p></td>
<td>No rotation.
</td>
</tr>
<tr>
<td><p><a name="GDK-PIXBUF-ROTATE-COUNTERCLOCKWISE:CAPS"></a><span class="term"><code class="literal">GDK_PIXBUF_ROTATE_COUNTERCLOCKWISE</code></span></p></td>
<td>Rotate by 90 degrees.
</td>
</tr>
<tr>
<td><p><a name="GDK-PIXBUF-ROTATE-UPSIDEDOWN:CAPS"></a><span class="term"><code class="literal">GDK_PIXBUF_ROTATE_UPSIDEDOWN</code></span></p></td>
<td>Rotate by 180 degrees.
</td>
</tr>
<tr>
<td><p><a name="GDK-PIXBUF-ROTATE-CLOCKWISE:CAPS"></a><span class="term"><code class="literal">GDK_PIXBUF_ROTATE_CLOCKWISE</code></span></p></td>
<td>Rotate by 270 degrees.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-pixbuf-rotate-simple"></a><h3>gdk_pixbuf_rotate_simple ()</h3>
<pre class="programlisting"><a class="link" href="gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf"><span class="returnvalue">GdkPixbuf</span></a> *         gdk_pixbuf_rotate_simple            (<em class="parameter"><code>const <a class="link" href="gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf"><span class="type">GdkPixbuf</span></a> *src</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gdk-pixbuf-%E7%BC%A9%E6%94%BE-(Scaling).html#GdkPixbufRotation" title="enum GdkPixbufRotation"><span class="type">GdkPixbufRotation</span></a> angle</code></em>);</pre>
<p>
旋转一个 pixbuf 90度的倍数，以一个新的 pixbuf 返回结果。
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>src</code></em> :</span></p></td>
<td>a <a class="link" href="gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf"><span class="type">GdkPixbuf</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>angle</code></em> :</span></p></td>
<td>旋转的角度</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>一个新的 <a class="link" href="gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf"><span class="type">GdkPixbuf</span></a>，内存不足返回 <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>。. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.6</p>
</div>
<hr>
<div class="refsect2">
<a name="gdk-pixbuf-flip"></a><h3>gdk_pixbuf_flip ()</h3>
<pre class="programlisting"><a class="link" href="gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf"><span class="returnvalue">GdkPixbuf</span></a> *         gdk_pixbuf_flip                     (<em class="parameter"><code>const <a class="link" href="gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf"><span class="type">GdkPixbuf</span></a> *src</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> horizontal</code></em>);</pre>
<p>
水平或竖直反转一个 pixbuf，以一个新的 pixbuf 返回结果。
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>src</code></em> :</span></p></td>
<td>a <a class="link" href="gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf"><span class="type">GdkPixbuf</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>horizontal</code></em> :</span></p></td>
<td>
<a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> 为水平反转，<a href="../glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> 竖直反转。</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>一个新的 <a class="link" href="gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf"><span class="type">GdkPixbuf</span></a>，内存不足返回 <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>。. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.6</p>
</div>
</div>
<div class="refsect1">
<a name="gdk-pixbuf-%E7%BC%A9%E6%94%BE-(Scaling).see-also"></a><h2>See Also</h2>
GdkRGB.
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.17</div>
</body>
</html>